//
//  DXMLEventObject.h
//  DerbyStatter
//
//  Created by glenn andreas on 1/29/14.
//  Copyright (c) 2014 glenn andreas. All rights reserved.
//

#import "DXMLObject.h"
@class DXMLTimestamp;

typedef enum {
    DXMLEventSourceUnknown,
    DXMLEventSourceManualEntry,
    DXMLEventSourceBoutRecreation,
    DXMLEventSourceScoreboard,

    // did this information come from the statbook?
    DXMLEventSourceStatBookIBRF = 1000,
    DXMLEventSourceStatBookScorekeeper,
    DXMLEventSourceStatBookPenaltyTracker,
    DXMLEventSourceStatBookLineupTracker,
    DXMLEventSourceStatBookPenaltyBox,
    DXMLEventSourceStatBookPeriodTimer,
    DXMLEventSourceStatBookActions,
    DXMLEventSourceStatBookErrors,
} DXMLEventSource;

@interface DXMLEventObject : DXMLObject

//@property (strong) DXMLTimestamp *timeStamp;
@property (assign) DXMLEventSource source;
@property (strong) NSString *notes; // these notes are actually the children DXMLNotesObject text
- (void) setEventSourceIfNeeded: (DXMLEventSource) source;
- (id) childOfClass: (Class) cls atIndex: (NSInteger) index;
// this will create it if need be
- (id) childOfClass: (Class) cls atIndex: (NSInteger) index source: (DXMLEventSource) source;
- (void) enumerateChildren: (void (^)(DXMLEventObject *child, BOOL *stop)) block ofClass: (Class) cls;
- (void) enumerateChildren: (void (^)(DXMLEventObject *child, BOOL *stop)) block;

- (NSInteger) numberOfChildrenOfClass: (Class) cls;

- (id) createChild: (Class) cls;
- (id) createChild: (Class) cls source: (DXMLEventSource) source;
// defined in DXMLObject
//- (void) addChild: (DXMLEventObject *) child;
//- (void) removeChild: (DXMLEventObject *) child;
@end
